/***************************************************************************
创建者：华磊
 开始时间：               : 2020.1１.09
 copyright            : (C) 深圳市华友高科有限公司
 修改说明：（每次有修改就添加一条，带有 修改人，修改时间，修改描述）

 ***************************************************************************
 *   顶部视窗对话框
*                                                                         *
 ***************************************************************************/
#include "jogcoordinate.h"
#include "ui_jogcoordinate.h"
#include "topview.h"
#include "hmicommondefine.h"
#include "instructionEnum.h"


JogCoordinate::JogCoordinate(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::JogCoordinate)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_QuitOnClose, false);
}

JogCoordinate::~JogCoordinate()
{
    delete ui;
}

void JogCoordinate::updateCurrentJogDate()
{
    if(topView->jogCoordinate == EM_JOG_COORDINATE_JOINT)
    {
        ui->radioButton->setChecked(true);
        ui->radioButton_2->setChecked(false);
        ui->radioButton_3->setChecked(false);
        ui->radioButton_4->setChecked(false);
    }
    else if(topView->jogCoordinate == EM_JOG_COORDINATE_TOOL)
    {
        ui->radioButton->setChecked(false);
        ui->radioButton_2->setChecked(true);
        ui->radioButton_3->setChecked(false);
        ui->radioButton_4->setChecked(false);
    }
    else if(topView->jogCoordinate == EM_JOG_COORDINATE_USER)
    {
        ui->radioButton->setChecked(false);
        ui->radioButton_2->setChecked(false);
        ui->radioButton_3->setChecked(true);
        ui->radioButton_4->setChecked(false);
    }
    else if(topView->jogCoordinate == EM_JOG_COORDINATE_WORLD)
    {
        ui->radioButton->setChecked(false);
        ui->radioButton_2->setChecked(false);
        ui->radioButton_3->setChecked(false);
        ui->radioButton_4->setChecked(true);
    }
    else
    {}
}

void JogCoordinate::changeLanguage()
{
    ui->retranslateUi(this);
}


void JogCoordinate::on_radioButton_clicked()
{
    emit changeJointCoordinate();
    //topView->updateJogCoordinateView();
}

void JogCoordinate::on_radioButton_2_clicked()
{
    emit changeToolCoordinate();
    //topView->updateJogCoordinateView();
}

void JogCoordinate::on_radioButton_3_clicked()
{
    emit changeUserCoordinate();
    //topView->updateJogCoordinateView();
}

void JogCoordinate::on_radioButton_4_clicked()
{
    emit changeWorldCoordinate();
    //topView->updateJogCoordinateView();
}
